package com.yunao.service.convert;

import com.yunao.commons.enums.ArticleType;
import com.yunao.commons.serachcore.core.bean.Article;
import com.yunao.entity.ArticleItem;

public class Article2Iten {

    public static ArticleItem convert(Article article){
        ArticleItem articleItem =  new ArticleItem();
        articleItem.setArticleText(article.getContent());
        articleItem.setSearchId(article.getId()+"");
//        articleItem.setArticleUserId(1);
        articleItem.setArticleUrl(article.getUrl());
        articleItem.setArticleType(ArticleType.FAVORITE.getCode());
        articleItem.setArticleTitle(article.getTitle());
        articleItem.setArticleSunmary(article.getSummary());
        articleItem.setArticlePubdate(article.getPubdate());
        articleItem.setArticleMessageType(article.getMessageType());
        articleItem.setArticleMediaType(article.getMediaType());
        articleItem.setArticleLocaltion(article.getLocation());
        articleItem.setArticleEmotion(article.getEmotion());
        articleItem.setArticleDomainSource(article.getDomainSource());
        articleItem.setArticleDomainLevel(article.getDomainLevel());
        articleItem.setArticleChannelCategory(article.getChannel());
        articleItem.setArticleAuthor(article.getAuthor());
        return  articleItem;
    }
}
